
@include('Home.head')
<style>

    .am-header-title a{
        color: #ffffff;
    }
    .am-navbar-nav a .am-navbar-label{
        font-size: 14px;
        margin-top: 6px;
    }
    .am-navbar{
        height: 60px;
    }


    .row {margin-bottom: .25rem;}
    .row > .cell-6 {
        width: 50%;
        padding: 2px 5px 5px 5px;
    }
    .row, .column {
        display: flex;
        margin: -.25rem -.25rem 0;
        margin-bottom: 0px;
        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-align-items: stretch;
        -ms-flex-align: stretch;
        align-items: stretch;
        -webkit-align-content: stretch;
        -ms-flex-line-pack: stretch;
        align-content: stretch;
        -webkit-flex: auto;
        -ms-flex: auto;
        flex: auto;
    }
    .row, .column {
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        margin: -.25rem -.25rem 0;
        margin-bottom: 0px;
        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-align-items: stretch;
        -ms-flex-align: stretch;
        align-items: stretch;
        -webkit-align-content: stretch;
        -ms-flex-line-pack: stretch;
        align-content: stretch;
        -webkit-flex: auto;
        -ms-flex: auto;
        flex: auto;
    }
    .wai {
        background-color: rgba(48,149,244,1.00);
        color: #000;
        text-align: center;
        border-radius: 5px;
        height: 75px;
        line-height: 25px;
        padding-top: 15px;
        background-image: url(http://www.tp5.com/uploads/2.png);
        background-size: cover;
        background-size: 100%;
    }
</style>
<body>
<div class="container" id="app">

{{--    @include('Home.member.header')--}}
    <header data-am-widget="header" class="am-header am-header-default my-header">
        <div class="am-header-left am-header-nav">
            <a  onclick="javascript:history.back(-1);" class="">
                <i class="am-header-icon am-icon-chevron-left"></i>
            </a>
        </div>
        <h1 class="am-header-title">
            <a href="#title-link" class="">@{{ title }}</a>
        </h1>
        <div class="am-header-right am-header-nav">
            <a href="/home/member/index" class="">
                <i class="am-header-icon  am-icon-home"></i>
            </a>
        </div>
    </header>
    <div class="am-cf uchome-apps">
    	<ul class="am-avg-sm-3 uchome-apps-ul">
            <li><a href="/home/stores/order"><p class="imgp"><img src="/img/home/user/uhomeapp3.png" class="am-img-responsive" /></p><p class="namep">门店订单</p><p class="lastp">@{{ ordernum }}笔</p></a></li>
            <li><a :href="'/home/stores/record?id=' + id " ><p class="imgp"><img src="/img/home/user/uhomeapp2.png" class="am-img-responsive" /></p><p class="namep">门店收益</p><p class="lastp">@{{ profit }}笔</p></a></li>
            <li><a href="/home/stores/inventory"><p class="imgp"><img src="/img/home/user/uhomeapp5.png" class="am-img-responsive" /></p><p class="namep">我的库存</p><p class="lastp">@{{ inventory }}个</p></a></li>
            <li><a href="/home/stores/friends"><p class="imgp"><img src="/img/home/user/uhomeapp11.png" class="am-img-responsive" /></p><p class="namep">门店伙伴</p><p class="lastp">@{{ friendsCount }}人</p></a></li>
            <li><a href="/home/stores/mystore"><p class="imgp"><img src="/img/home/user/myInfo.png" class="am-img-responsive" /></p><p class="namep">我的门店</p>   
                    <p v-show="status == 0" class="lastp" >申请中</p>
                    <p v-show="status == 1" class="lastp" >已通过</p>
                    <p v-show="status == 2" class="lastp" >驳回</p>
                </a>
            </li>
            <!-- <li><a href="/home/stores/purchase"><p class="imgp"><img src="/img/home/user/uhomeapp14.png" class="am-img-responsive" /></p><p class="namep">我要进货</p><p class="lastp">已开通</p></a></li> -->
            <!-- <li><a href="/home/stores/purchaseRecord"><p class="imgp"><img src="/img/home/user/uhomeapp15.png" class="am-img-responsive" /></p><p class="namep">进货记录</p><p class="lastp">@{{ purchase }}笔</p></a></li> -->
            <li><a href="/home/stores/replenish"><p class="imgp"><img src="/img/home/user/uhomeapp16.png" class="am-img-responsive" /></p><p class="namep">我要补货</p><p class="lastp">已开通</p></a></li>
            <li><a href="/home/stores/replenishRecord"><p class="imgp"><img src="/img/home/user/uhomeapp17.png" class="am-img-responsive" /></p><p class="namep">补货记录</p><p class="lastp">@{{replenish}}笔</p></a></li>

             <!-- <li><a href="#"><p class="imgp"><img src="/img/home/user/userinfo.png" class="am-img-responsive" /></p><p class="namep">客户档案</p><p class="lastp">开发中</p></a></li> -->

             <!-- <li><a href="#"><p class="imgp"><img src="/img/home/user/othershop.png" class="am-img-responsive" /></p><p class="namep">其他商品</p><p class="lastp">开发中</p></a></li> -->
        </ul>

    </div>
    @include('Home.foot')
</div>
</body>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            title: '门店中心',
            count:{

            },
            phone:"{{ Session::get('home_user')->phone }}",
            status:0,
            ordernum:0,
            profit:0,
            inventory:0,
            friendsCount:0,
            purchase:0,
            replenish:0,
            id:''
        },
        methods: {
            //初始化 系统管理员列表
            initialize: function () {
                $.post("/home/stores/stores", {'_token': '{{csrf_token()}}',class:'first'}, function (res) {
                    if (res.code) {
                        // console.log(res)
                        app.status = res.data.type;
                        app.ordernum = res.rico;
                        app.profit = res.profit;
                        app.inventory = res.inventory;
                        app.friendsCount = res.friendsCounts;
                        app.purchase = res.purchase;
                        app.replenish = res.replenish;
                        app.id = res.data.id;
                    }
                });

                {{--$.post("/home/member/checkMemberInfo", {'_token': '{{csrf_token()}}'}, function (res) {--}}
                    {{--if (res.code==0) {--}}
                        {{--layer.msg(res.data);--}}
                        {{--// console.log(res.href_url);--}}
                        {{--// location.href= res.href_url;--}}
                    {{--}--}}
                {{--});--}}
            },
            activity:function () {
                // location.href = "/home/member/activity";
            }
        },
        //自动执行
        mounted: function () {
            this.initialize();
        },
    })
</script>
@if (count($errors) > 0)
    @foreach ($errors->all() as $error)
        <script>
            layer.msg("{{$error}}");
        </script>
        @endforeach
        @endif
</html>
